package org.example.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.example.domain.Identity;
import org.example.domain.Role;
import org.example.domain.bean.LoginRequest;
import org.example.domain.bean.RestResponse;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zby
 * @since 2021-04-11
 */
public interface IIdentityService extends IService<Identity> {
    /**
     * 登录之后返回token
     * @param loginRequest
     * @param request
     * @return
     */
    RestResponse<Map<String,String>> login(LoginRequest loginRequest, HttpServletRequest request);

    /**
     * 根据用户名获取用户
     * @param username
     * @return
     */
    Identity getIdentityByUserName(String username);

    /**
     * 根据用户id查询角色列表
     * @param identityId
     * @return
     */
    List<Role> getRoles(Long identityId);
}
